<template>
  <!-- 热门品牌模块 -->
  <HomePanel title="热门品牌" subTitle="国际经典品质保证">
      <template #right>
          <span>[]</span>
      </template>
    <template #>
      <ul ref="pannel" class="goods-list">
        <li v-for="item in list" :key="item.id">
          <RouterLink to="/">
            <img :src="item.picture" alt="" />
          </RouterLink>
        </li>
      </ul>
    </template>
  </HomePanel>
</template>

<script>
import HomePanel from './home-panel'
import { findBrand } from '@/api/home'
import { onMounted, ref } from 'vue'
export default {
  components: {
    HomePanel
  },
  setup () {
    const list = ref([])
    async function recommendFn () {
      const res = await findBrand({
        limit: 4
      })
      console.log('热门品牌有', res.data.result)
      list.value = res.data.result
    }
    onMounted(() => {
      recommendFn()
    })
    return {
      list
    }
  }
}
</script>

<style scoped lang='less'>
.goods-list {
  display: flex;
  justify-content: space-between;
  height: 406px;
  li {
    height: 300px;
    background: #f0f9f4;
    img {
      width: 300px;
      height: 300px;
    }
    .price {
      color: @priceColor;
    }
  }
}
</style>
